package com.xyb.vo;

import com.xyb.entity.SysMenu;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SysMenuVo {
    public interface insert {
    }

    public interface update {
    }

    /**
     * 菜单id
     */
    @NotNull(message = "menuId 不能为空", groups = {SysMenuVo.update.class})
    private Long menuId;
    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称 不能为空")
    @Length(max = 10, message = "菜单名称不得超过10个字符", groups = {SysMenuVo.insert.class, SysMenuVo.update.class})
    private String menuName;
    /**
     * 菜单code
     */
    @Length(max = 20, message = "菜单code不得超过20个字符", groups = {SysMenuVo.insert.class, SysMenuVo.update.class})
    private String menuCode;
    /**
     * 菜单图标
     */
    @Length(max = 30, message = "菜单图标不得超过20个字符", groups = {SysMenuVo.insert.class, SysMenuVo.update.class})
    private String menuIcon;
    /**
     * 父级菜单id
     */
    @NotNull(message = "父节点id不能为空")
    private Long menuPid;
    /**
     * 显示顺序
     */
    private Long showOrder;

    private List<SysMenu> menuList;
}
